// var CallbackEvent = require('CallbackEvent');
cc.Class({
    extends: cc.Component,

    properties: {
        head_sp: cc.Sprite,
        All_info: cc.SpriteAtlas,
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {

    },

    start() {

    },
    init(head_sp, _id) {
        this.id = _id;
        this.node.dispatchEvent(new cc.Event.EventCustom('foobar', true));
        this.head_sp.getComponent(cc.Sprite).spriteFrame = this.All_info.getSpriteFrame(head_sp);
    },
    click() {
        var _event = new cc.Event.EventCustom('foobar', true);
        _event.detail = {
            id: this.id,
        };

        this.node.dispatchEvent(_event);
    },

    // update (dt) {},
});

